<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		$('#example').dataTable( {
			"sScrollY": "800px",
			"bPaginate": false,
			"bScrollCollapse": true
		} );
	});
</script>

<script type="text/javascript">
	$(document).ready(function() {
	});

	function laporan(pageURL, title,w,h){

		var periode_awal=document.getElementById('tanggal_awal').value;

		var periode_akhir=document.getElementById('tanggal_akhir').value;

		if ((periode_awal=='')||(periode_akhir=='')){

			alert('Isilah periode awal dan akhir');

		}else{

			var left = (screen.width/2)-(w/2);

			var top = (screen.height/2)-(h/2);

			var targetWin = window.open ('<?=site_url();?>/anggaran/view_lap_biaya_periode/'+periode_awal+'/'+periode_akhir, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);

			

			document.getElementById('tanggal_awal').value='';

			document.getElementById('tanggal_akhir').value='';

		}
	}

	

	$(function(){

		$("#tanggal_awal").datepicker({dateFormat: 'yy-mm-dd' });

	})	

	

	$(function(){

		$("#tanggal_akhir").datepicker({dateFormat: 'yy-mm-dd' });

	})	

	

		

	function klick_tanggal_awal(){

		var tanggal = document.getElementById("tanggal_awal");

		tanggal.focus();

	}

	

	function klick_tanggal_akhir(){

		var tanggal = document.getElementById("tanggal_akhir");

		tanggal.focus();

	}

	

	function batal(){

		document.location.href="<?=site_url();?>/anggaran";

	}

	

</script>


	<?php 
		if(validation_errors())
		{
	?>
			<ul class="message error grid_12">
				<li><?=validation_errors()?></li>
				<li class="close-bt"></li>
			</ul>	
	<?php
		} 
	?>
<div id="page-heading"><h1>Anggaran >> Daftar Data Anggaran</h1></div>
<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
<tr>
	<th rowspan="3" class="sized"><img src="<?php echo base_url() ?>asset/admin/images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
	<th class="topleft"></th>
	<td id="tbl-border-top">&nbsp;</td>
	<th class="topright"></th>
	<th rowspan="3" class="sized"><img src="<?php echo base_url() ?>asset/admin/images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
</tr>
<tr>
	<td id="tbl-border-left"></td>
	<td> 
		<div id="content-table-inner">
		<div id="table-content">
		<table border="0" width="100%" cellpadding="0" cellspacing="0">
		
		<tr valign="top">
			<td>			
			
			<div id="step-holder">
						<div class="step-no">1</div>
						<div class="step-light-left">
							<?php 
								echo anchor('anggaran/index', 'Daftar File Upload');
							?>
						</div>
						<div class="step-light-right">&nbsp;</div>
						<div class="step-no">2</div>
						<div class="step-light-left">
							<?php  
								echo anchor('anggaran/add', 'Import Data Anggaran');
						?>
						</div>
						<div class="step-light-right">&nbsp;</div>
						<div class="step-no">3</div>
						<div class="step-dark-left">
							<?php 
								$now = date('m')-1;
								$now2 = '1-'.$now.'-'.date('Y');
								$now3 = '31-'.$now.'-'.date('Y');
								echo anchor('anggaran/verifikasi', 'Daftar Data Anggaran');
						?>
						</div>
						<div class="step-dark-right">&nbsp;</div>
						<div class="step-no">4</div>
						<div class="step-light-left">
							<?php
								echo anchor('anggaran/report', 'Ekspor Data');
							?>
						</div>
						<div class="step-light-round">&nbsp;</div>
					 
					 <br/>
					 <br/>
					
					
					<!--  start step-holder -->
					 
					<?php 
					echo '<br/><br/><br/><br/>';
					$i=0;
					foreach($tahun_tombol->result() as $row2) { $i=$i+1;?>
						<?php if ($tahun != $row2->tahun){
							echo '<div class="step-no">'.$i .'</div>';
							echo '<div class="step-light-left">';
							echo anchor('anggaran/verifikasi/'.$row2->tahun .'', ''.$row2->tahun .'');
							echo '</div>'; 
							echo '<div class="step-light-right">&nbsp;</div>';
						}
						else
						{
							echo '<div class="step-no">'.$i .'</div>';
							echo '<div class="step-dark-left">';
							echo anchor('anggaran/verifikasi/'.$row2->tahun .'', ''.$row2->tahun .'');
							echo '</div>'; 
							echo '<div class="step-dark-right">&nbsp;</div>';
						}?> 
					<?php } ?>
				</div>
			<br/> <br/> <br/> <br/> <br/>
			
			 
			<?php 
				$attributes = array('name' => 'form1', 'id' => 'form1', 'class'=>'block-content form');
				echo form_open_multipart('anggaran/process_update', $attributes);
			?>
			<!--
			<table align="right" border="0"  cellpadding="0" cellspacing="0"   >
			
					<tr>
						<td align="right" colspan="7">
							<input type="submit" value="Simpan" class="form-submit" />
							<input type="reset" value="Batal" class="form-reset" onclick="javascript:batal();" />
						</td>
					</tr>
			</table>
			-->
			<br/> 
				<table border="0" width="100%" cellpadding="0" cellspacing="0" class="display" id="example">
				<thead>
					<tr>										
						<th class="table-header-repeat line-left minwidth-0" width="10px"><a href="">Nomor</a></th> 
						<th class="table-header-repeat line-left minwidth-1"><a href="">Parent</a></th>	
						<th class="table-header-repeat line-left minwidth-0"><a href="">Kode</a></th>		 						
						<th class="table-header-repeat line-left minwidth-1"><a href="">Uraian</a></th>  
						<th class="table-header-repeat line-left minwidth-1"><a href="">Nilai</a></th>		 						
					</tr>
				</thead>
				<tbody> 
				<?php 
				$i=0;
				foreach($results->result() as $row) 
				{
				$i=$i+1;
				?>
				 
				<?
				
				$hasil1=strlen(str_replace(" ", "", $row->kode));
				
			 
				if(((preg_match("/[.]/",$row->kode ))&&($hasil1 == 8))&&(preg_match("/[0-9]/",$row->kode )))
				{
					echo "<tr>";
					echo "<td>".$i."</td>";
					echo "<td>".$row->parent."</td>";
					
					echo "<td>&nbsp;&nbsp;";
					echo "&nbsp;&nbsp;";
					echo "<b>".$row->kode."</b>"; 
					echo "&nbsp;</td>";
					echo "<td><b>".$row->uraian."</b></td>";
					echo "<td style='text-align:right'><b>".convert_rupiah_non_rp($row->jumlah)."</b></td>";
					 
					 
					
					echo "</tr>"; 
				}
				elseif((preg_match("/[.]/",$row->kode ))&&(preg_match("/[0-9]/",$row->kode )))
				{
					echo "<tr>";
					echo "<td>".$i."</td>";
					echo "<td>".$row->parent."</td>";
					echo "<td><b>".$row->kode."</b>";  
					echo "&nbsp;</td>";
					echo "<td><b>".$row->uraian."</b></td>";
					echo "<td style='text-align:right'><b>".convert_rupiah_non_rp($row->jumlah)."</b></td>";
					 
					 
					echo "</tr>"; 
				}
				elseif(($hasil1 == 4)&&(preg_match("/[0-9]/",$row->kode )))
				{
					echo "<tr>";
					echo "<td>".$i."</td>";
					echo "<td>".$row->parent."</td>";
					echo "<td>&nbsp;&nbsp;";
					echo "<b>".$row->kode."</b>"; 
					echo "&nbsp;</td>";
					echo "<td><b>".$row->uraian."</b></td>";
					echo "<td style='text-align:right'><b>".convert_rupiah_non_rp($row->jumlah)."</b></td>";
					 
					 
					 
					echo "</tr>"; 
				}
				
				elseif(($hasil1 == 3)&&(preg_match("/[0-9]/",$row->kode )))
				{
					echo "<tr>";
					echo "<td>".$i."</td>";
					echo "<td>".$row->parent."</td>";
					echo "<td>&nbsp;&nbsp;";
					echo "&nbsp;&nbsp;";
					echo "&nbsp;&nbsp;";
					echo "<b>".$row->kode."</b>"; 
					echo "&nbsp;</td>";
					echo "<td><b>".$row->uraian."</b></td>";
					echo "<td style='text-align:right'><b>".convert_rupiah_non_rp($row->jumlah)."</b></td>";
					 
					 
					 
					echo "</tr>"; 
				}
				elseif(preg_match("/[a-zA-Z]/",$row->kode ))
				{ 
					echo "<tr>";
					echo "<td>".$i."</td>";
					echo "<td>".$row->parent."</td>";
					echo "<td>&nbsp;&nbsp;";
					echo "&nbsp;&nbsp;";
					echo "&nbsp;&nbsp;";
					echo "&nbsp;";
					echo "<b>".$row->kode."</b>"; 
					echo "&nbsp;</td>";
					echo "<td><b>".$row->uraian."</b></td>";
					echo "<td style='text-align:right'><b>".convert_rupiah_non_rp($row->jumlah)."</b></td>";
					 
					 
					 
					echo "</tr>"; 
				}
				else if(preg_match("/[0-9]/",$row->kode ))
				{
					echo "<tr>";
					echo "<td>".$i."</td>";
					echo "<td>".$row->parent."</td>";
					echo "<td>&nbsp;&nbsp;";
					echo "&nbsp;&nbsp;";
					echo "&nbsp;&nbsp;";
					echo "&nbsp;&nbsp;";
					echo "&nbsp;&nbsp;";
					echo "<b>".$row->kode."</b>"; 
					echo "&nbsp;</td>";
					echo "<td><b>".$row->uraian."</b></td>";
					echo "<td style='text-align:right'><b>".convert_rupiah_non_rp($row->jumlah)."</b></td>";
					 
					 
					 
					echo "</tr>"; 
					 
				}
				
				elseif((preg_match("/[>]/",$row->uraian )) or (preg_match("/[>>]/",$row->uraian )))
				{
					
						echo "<tr>";
					echo "<td>".$i."</td>";
					echo "<td>".$row->parent."</td>";
						//echo "<td><b>".$row->kode."</b></td>";
						echo "<td>&nbsp;&nbsp;";
						echo "&nbsp;&nbsp;";
						echo "&nbsp;&nbsp;";
						echo "&nbsp;&nbsp;";
						echo "&nbsp;&nbsp;";
						echo "&nbsp;&nbsp;";
						echo "<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;>&nbsp;&nbsp;&nbsp;</b>";
						echo "&nbsp;</td>";
					echo "<td><i><u>".$row->uraian."</u></i></td>";
					echo "<td style='text-align:right'>".convert_rupiah_non_rp($row->jumlah)."</td>";
					 
					 
						 
						echo "</tr>"; 
				}
				elseif(preg_match("/[-]/",$row->uraian ))
				{
						echo "<tr>";
					echo "<td>".$i."</td>";
					echo "<td>".$row->parent."</td>";
					
						//echo "<td><b>".$row->kode."</b></td>";
						echo "<td>&nbsp;&nbsp;";
						echo "&nbsp;&nbsp;";
						echo "&nbsp;&nbsp;";
						echo "&nbsp;&nbsp;";
						echo "&nbsp;&nbsp;";
						echo "&nbsp;&nbsp;";
						echo "&nbsp;&nbsp;";
						echo "<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;</b></td>";
						
					echo "<td>".$row->uraian."</td>";
					//echo "<td>".$row->uraian."</td>";
					echo "<td style='text-align:right'>".convert_rupiah_non_rp($row->jumlah)."</td>";
					 
					 
						 echo "</tr>";
						 
				}
				else
				{
						echo "<tr>";
					echo "<td>".$i."</td>";
					echo "<td>".$row->parent."</td>";
						echo "<td><b>".$row->kode."</b></td>";
						echo "<td>kosong</td>";
						echo "<td>&nbsp;</td>";
						echo "<td>&nbsp;</td>";
						echo "<td>&nbsp;</td>";
						echo "<td>&nbsp;</td>";
						echo "<td>&nbsp;</td>";
					echo "<td>".$row->uraian."</td>";
					echo "<td style='text-align:right'>".convert_rupiah_non_rp($row->jumlah)."</td>";
					 
					 
						echo "</tr>";
				}
				?>
				<?php } ?>	
				</tbody> 
			</table> 
			
			
			
			
			<!--
			<table align="right" border="0"  cellpadding="0" cellspacing="0"   >
					<tr>
						<td align="right" colspan="7">
							<input type="submit" value="Simpan" class="form-submit" />
							<input type="reset" value="Batal" class="form-reset" onclick="javascript:batal();" />
						</td>
					</tr>
			</table>
			-->
			</form>		
		</div>
		</td>
		</tr> 		 
	</div> 
	</td>
</tr>
</table>

<div class="clear"></div>
 

</div>	</div>
</td>
<td id="tbl-border-right"></td>
</tr>
<tr>
	<th class="sized bottomleft"></th>
	<td id="tbl-border-bottom">&nbsp;</td>
	<th class="sized bottomright"></th>
</tr>
</table>
 


			